<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>
            <if condition="ACTION_NAME eq 'add'">
                新增栏目
            <else/>
                编辑栏目
            </if>
            <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>
    <form action="" method="post" class="form">
        <div class="form-item form-group">
            <label class="item-label">标题<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="form-control text input-small" name="title" value="{$title}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">CODE<span class="check-tips">用于客户端判断</span></label>
            <div class="controls">
                <input type="text" class="form-control text input-small" name="code" value="{$code}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">排序<span class="check-tips">整数，升序排列</span></label>
            <div class="controls">
                <input type="text" class="form-control text input-mini" name="sort" value="{$sort}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">接口地址<span class="check-tips">/api/AppTopic/*******</span></label>
            <div class="controls">
                <input type="text" class="form-control text input-large" name="href" value='{$href}'>
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">模板<span class="check-tips">json,标明数据展示模板类型</span></label>
            <div class="controls">
                <input type="text" class="form-control text input-large" name="template" value='{$template}'>
            </div>
        </div>

        <div class="form-item form-group">
            <label class="item-label">状态<span class="check-tips"></span></label>
            <label class="radio-inline">
            <input type="radio" name="status" <if condition="$status eq 1 or $status eq ''">checked</if> value="1"  /> 开启
            </label>
            <label class="radio-inline">
            <input type="radio" name="status" <eq name="status" value="0">checked</eq> value="0" />关闭
            </label>
        </div>
        <div class="form-item form-group form-action">
            <input type="hidden" name="id" value="{$id}" />
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
            <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Topic/index')}');
    </script>
</block>
